#include <iostream>
using namespace std;

class Test{
    private:
        int a;
        int b;
        int &r;
        const int num;
    public:
        Test(int a, int b, int &c, int d):a(a), b(b), r(c), num(d){
            cout << "有参构造函数" << endl;
        }
        void show(){
            cout << a << " " << b << " " \
                << r << " " << num << endl;
        }
};

int main(int argc, const char *argv[]){
    int x = 30;
    Test t1(10, 20, x, 40);
    t1.show(); // 10 20 30 40 
    return 0;
}